<?php
/**
 * Item.php
 *
 * @copyright   2023 thingsworld.com.cn - All Rights Reserved
 * @link        http://thingsworld.com.cn/
 * @author      stiffer.chen <chenl@thingsworld.com.cn>
 * @created     2023-05-18 18:08:17
 * @modified    2023-05-18 18:08:17
 *
 */

namespace App\Models\InventoryAllot;

use App\Models\BaseModel;
use App\Models\Inventory;
use App\Models\InventoryAllot;

class Item extends BaseModel
{
    protected $table = 'inventory_allot_items';
    protected $primaryKey = 'id';

    public $timestamps = true;
    public const CREATED_AT = 'create_time';
    public const UPDATED_AT = 'update_time';

    protected $fillable = [
        'inventory_allot_id',
        'inventory_id',
        'quantity',
        'action_quantity'
    ];

    public function inventory()
    {
        return $this->belongsTo(Inventory::class);
    }

    public function inventory_allot()
    {
        return $this->belongsTo(InventoryAllot::class);
    }
}